﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

using Whoever.Framework.Attributes;

namespace Whoever.Framework.Base
{
    public class EntityViewModel
    {
        public EntityViewModel(BusinessEntity entity, Type entityType)
        {
            this.Entity = entity;
            this.EntityType = entityType;
            this.PropertyList = Entity.GetType().GetProperties();

            this.Page = 1;
            this.SortDir = "ASC";
        }

        public BusinessEntity Entity { get; set; }

        public Type EntityType { get; set; }

        public string EntityDisplayName { get; set; }

        public IEnumerable<PropertyInfo> PropertyList { get; set; }

        public int Page { get; set; }

        public string Sort { get; set; }

        public string SortDir { get; set; }
    }
}
